[ 'dropField', 'change_tag', 'ct_tag', 'patch-drop-ct_tag.sql' ],
[ 'dropTable', 'valid_tag' ],
[ 'dropTable', 'tag_summary' ],
+ [ 'dropPgField', 'archive', 'ar_comment' ],
+ [ 'dropDefault', 'archive', 'ar_comment_id' ],
+ [ 'dropPgField', 'ipblocks', 'ipb_reason' ],
+ [ 'dropDefault', 'ipblocks', 'ipb_reason_id' ],
+ [ 'dropPgField', 'image', 'img_description' ],
+ [ 'dropDefault', 'image', 'img_description_id' ],
+ [ 'dropPgField', 'oldimage', 'oi_description' ],
+ [ 'dropDefault', 'oldimage', 'oi_description_id' ],
+ [ 'dropPgField', 'filearchive', 'fa_deleted_reason' ],
+ [ 'dropDefault', 'filearchive', 'fa_deleted_reason_id' ],
+ [ 'dropPgField', 'filearchive', 'fa_description' ],
+ [ 'dropDefault', 'filearchive', 'fa_description_id' ],
+ [ 'dropPgField', 'recentchanges', 'rc_comment' ],
+ [ 'dropDefault', 'recentchanges', 'rc_comment_id' ],
+ [ 'dropPgField', 'logging', 'log_comment' ],
+ [ 'dropDefault', 'logging', 'log_comment_id' ],
+ [ 'dropPgField', 'protected_titles', 'pt_reason' ],
+ [ 'dropDefault', 'protected_titles', 'pt_reason_id' ],
];
}
protected function setDefault( $table, $field, $default ) {
$info = $this->db->fieldInfo( $table, $field );
- if ( $info->defaultValue() !== $default ) {
+ if ( $info && $info->defaultValue() !== $default ) {
$this->output( "Changing '$table.$field' default value\n" );
$this->db->query( "ALTER TABLE $table ALTER $field SET DEFAULT "
. $this->db->addQuotes( $default ) );
public function addPgExtIndex( $table, $index, $type ) {
if ( $this->db->indexExists( $table, $index ) ) {
$this->output( "...index '$index' on table '$table' already exists\n" );
+ } elseif ( preg_match( '/^\(/', $type ) ) {
+ $this->output( "Creating index '$index' on table '$table'\n" );
+ $this->db->query( "CREATE INDEX $index ON $table $type" );
} else {
- if ( preg_match( '/^\(/', $type ) ) {
- $this->output( "Creating index '$index' on table '$table'\n" );
- $this->db->query( "CREATE INDEX $index ON $table $type" );
- } else {
- $this->applyPatch( $type, true, "Creating index '$index' on table '$table'" );
- }
+ $this->applyPatch( $type, true, "Creating index '$index' on table '$table'" );
}
}